#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, x, y;
struct Node {
  char c;
  int x, y;
} a[10];
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
bool check(int x, int y) {
  if (x < 1 || x > 3 || y < 4 || y > 6) return true;
  rep(i, 1, n) {
    if (a[i].x == x && a[i].y == y) continue;
    if (a[i].c == 'R' || a[i].c == 'G') {
      if (a[i].x == x) {
        int l = min(a[i].y, y);
        int r = max(a[i].y, y);
        bool fail = false;
        rep(j, 1, n) {
          if (a[j].x == x && a[j].y > l && a[j].y < r) {
            fail = true;
            break;
          }
        }
        if (!fail) return true;
      }
      if (a[i].y == y) {
        int t = min(a[i].x, x);
        int b = max(a[i].x, x);
        bool fail = false;
        rep(j, 1, n) {
          if (a[j].y == y && a[j].x > t && a[j].x < b) {
            fail = true;
            break;
          }
        }
        if (!fail) return true;
      }
    }
    if (a[i].c == 'H') {
      int disx = x - a[i].x, disy = y - a[i].y;
      if (abs(disx) + abs(disy) == 3 && disx && disy) {
        int nx = a[i].x, ny = a[i].y;
        if (disx == 2 || disx == -2)
          nx += disx / 2;
        else
          ny += disy / 2;
        bool fail = false;
        rep(j, 1, n) if (a[j].x == nx && a[j].y == ny) {
          fail = true;
          break;
        }
        if (!fail) return true;
      }
    }
    if (a[i].c == 'C') {
      if (a[i].x == x) {
        int l = min(a[i].y, y);
        int r = max(a[i].y, y);
        int cnt = 0;
        rep(j, 1, n) {
          if (a[j].x == x && a[j].y > l && a[j].y < r) {
            cnt++;
          }
        }
        if (cnt == 1) return true;
      }
      if (a[i].y == y) {
        int t = min(a[i].x, x);
        int b = max(a[i].x, x);
        int cnt = 0;
        rep(j, 1, n) {
          if (a[j].y == y && a[j].x > t && a[j].x < b) {
            cnt++;
          }
        }
        if (cnt == 1) return true;
      }
    }
  }
  return false;
}
bool check() {
  rep(i, 1, n) {
    if (a[i].c == 'G' && a[i].y == y) {
      int t = min(a[i].x, x);
      int b = max(a[i].x, x);
      int cnt = 0;
      rep(j, 1, n) {
        if (a[j].y == y && a[j].x > t && a[j].x < b) cnt++;
      }
      if (!cnt) return false;
    }
  }
  rep(i, 0, 3) {
    int nx = x + dx[i], ny = y + dy[i];
    if (!check(nx, ny)) {
      // cout << nx << ' ' << ny << endl;
      return false;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  while (cin >> n >> x >> y) {
    if (!n && !x && !y) break;
    rep(i, 1, n) cin >> a[i].c >> a[i].x >> a[i].y;
    cout << (check() ? "YES\n" : "NO\n");
  }
  return 0;
}